from .common import *
from .DjangoPathsSettingsPanelEx import *

class DjangoPathsSettingsPanel(wx.Panel):
    def __init__( self, parent):
        wx.Panel.__init__(self, parent, wx.ID_ANY)

        self.btns: List[buttons.GenButton] = []

        self._init_UI()

    def _init_UI(self):
        """初始化UI"""
        sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(sizer)
        self.SetAutoLayout(True)
        self.SetBackgroundColour(CON_COLOR_MAIN)

        self.panel = wx.Panel(self, wx.ID_ANY)
        topsizer = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(topsizer)
        topsizer.SetSizeHints(self.panel)
        sizer.Add(self.panel, 1, wx.EXPAND)

        '''
            用滚动面板存储所有控件，适配更小屏幕使用
        '''
        self.scollPanel = scrolledpanel.ScrolledPanel(self.panel, -1)
        self.scollPanel.SetupScrolling()
        self.scollPanelSizer = wx.BoxSizer(wx.VERTICAL)
        self.scollPanel.SetSizer(self.scollPanelSizer)
        topsizer.Add(self.scollPanel, 1, wx.EXPAND | wx.ALL, 0)
        self.scollPanel.SetBackgroundColour(CON_COLOR_GREY)

        '''
            根路径配置
        '''
        rootpath_manage_panel = CollapsibleRootPathManage(self.scollPanel)
        self.scollPanelSizer.Add(rootpath_manage_panel, 0, wx.EXPAND | wx.ALL, 0)
        
        '''
            文件别名设置
        '''
        alias_manage_panel = CollapsibleAliasManage(self.scollPanel)
        self.scollPanelSizer.Add(alias_manage_panel, 0, wx.EXPAND | wx.ALL, 0)
